<?php
/**
 * Created by PhpStorm.
 * User: pf
 * Date: 2017/12/15
 * Time: 14:13
 */

namespace App\Repositories;

use App\ComboActivity;

class ActivityRepository
{
    public function getList()
    {
        return ComboActivity::where('status', 1)->paginate(10);
    }
    public function getCount(){
        return ComboActivity::where('status',1)->count();
    }
    public function getDetail($id)
    {
        $comboActivity = ComboActivity::with('combo')
            ->where('status', 1)
            ->where('id', $id)
            ->firstOrFail();
        /*   $orderRepository = new OrderRepository();
           $comboActivity->combo=$comboActivity->combo->filter(function ($value, $key) use($orderRepository) {
                return $orderRepository->checkActivity($value);
            })->all();*/

        return $comboActivity;
    }
}